// 入口文件
const templatePaths = require('./paths');

const Generator = require('yeoman-generator');

module.exports = class extends Generator {
  answers = {};
  async prompting() {
    const answers = await this.prompt([
      {
        type: "input",
        name: "name",
        message: "Your project name",
        default: this.appname // Default to current folder name
      }
    ]);
    this.answers = answers;
  }
  write() {
    templatePaths.forEach(item => {
      this.fs.copyTpl(this.templatePath(item), this.destinationPath(item), { name: this.answers.name });
    });
  }
}

